package com.reran.geek.demo.Week03.homework1;

import com.reran.geek.demo.Week03.gateway.filter.HttpRequestFilter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.FullHttpRequest;

/**
 * @description:
 * @author: WangSiTeng
 * @date: 2021/11/21
 */
public class ReranInboundFilter implements HttpRequestFilter {
    @Override
    public void filter(FullHttpRequest fullRequest, ChannelHandlerContext ctx) {
        String uri = fullRequest.getUri();
        if (uri.contains("/test")) {
            // pass
        } else {
            throw new RuntimeException("bad uri! uri:" + uri);
        }
    }
}
